package com.ad.backstage.common.interceptor;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author:dxgong
 * @日期 2021/3/26 15:37
 * @注释
 */
@Component
@EnableWebMvc
public class MyWebMvcConfigurerAdapter implements WebMvcConfigurer {


    @Autowired
    private WebInterceptorAdapter webInterceptorAdapter;


    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(webInterceptorAdapter).addPathPatterns("/**")
                .excludePathPatterns("/**/login/**");
//                .excludePathPatterns("/swagger-resources/**", "/webjars/**", "/v2/**", "/swagger-ui.html/**","/doc.html");

    }

}
